package com.arpa.wms.service.impl;

import com.arpa.ntocc.common.common.util.CommonUtil;
import com.arpa.wms.domain.dto.CollectItemDTO;
import com.arpa.wms.domain.entity.CollectItem;
import com.arpa.wms.domain.vo.CollectItemVO;
import com.arpa.wms.mapper.CollectItemMapper;
import com.arpa.wms.service.ICollectItemService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 领用单明细 服务实现类
 * @author jinss
 * @date 2020-08-20 14:30:42
 **/
@Service
public class CollectItemServiceImpl extends ServiceImpl<CollectItemMapper, CollectItem> implements ICollectItemService {

    @Override
    public List<CollectItemVO> queryList(CollectItemDTO collectItemDTO) {
        //排序字段名需要驼峰转数据库下划线类型字段名
        if(StringUtils.isNotEmpty(collectItemDTO.getSortField())){
            collectItemDTO.setSortField(CommonUtil.camel2Underline(collectItemDTO.getSortField()));
        }
        List<CollectItemVO> collectItemVOList = baseMapper.queryList(collectItemDTO);
        return collectItemVOList;
    }
}
